
Yacon = {
    version : '1.0.0',
    versionDetail : {
        major : 1,
        minor : 0,
        patch : 0
    },
    
    IDseq :0,
    
    regCheck: function (reg)
    {
        return reg.test(window.uag);
    },
 
    apply:function(obj, org, defaults)
    {
       	if(defaults){
       		Yacon.apply(obj, defaults);
        }  
    	
        if(obj && org && typeof org == 'object'){
            for(var p in org){
            	
                if (Yacon.isObject(obj))
                	obj[p] = org[p];
                else
                	obj.prototype[p] = org[p];
            }
        }
        return obj;
    },
    native :function(obj, org)
    {
    	var bridge = function() {};
    	bridge.prototype = new obj();
    	if(bridge && org && typeof org == 'object'){
            for(var p in org){            	
            	bridge.prototype[p] = org[p];
            }
        }
    	
    	return bridge;

    },
  
	Extend:function(self,par,arg)
	{    	
       	if (!par)
   		  par = Object;    	 
    	  
    	  
    	  var parObj = new par();
    	  self.prototype = parObj;
    	  self.prototype.constructor = self; 
    	  self.prototype.superclass = parObj;
    	  
		  if(par.constructor == Object.prototype.constructor) 
		  {
			  par.prototype.constructor = par;
		  }
		 
		 if(typeof arg == 'object'){
			 for(var p in arg)
			 {
				 self.prototype[p]=arg[p];
        	 } 
        } 
		
    	return self;
	},
	
	getElement : function(el){
        if(!el || !document){
            return null;
        }
        if (el.element){
            return el.element;
        } else {
            if (typeof el == 'string') {
                var e = document.getElementById(el);
                if (e && window.isIE) {
                    if (el == e.getAttribute('id')) {
                        return e;
                    } else {
                        return null;
                    }
                }
                return e;
            } else {
                return el;
            }
        }
    },
    removeChild:function(element)
    {
    	if (!element.hasChildNodes())
    		return;
    	
    	var childLength=element.childNodes.length; 
    	for(var i= childLength-1;i>=0;i--)
    	{ 
    	    var child=element.childNodes(i);
    	    if (element.hasChildNodes())
    	    	this.removeChild(child);
    	    
    	    element.removeChild(child); 
    	}
    },  
    getAbsPosition:function (obj, offObj){
    	var _offObj = (offObj)?offObj:document.body;
    	var x = obj.offsetLeft;
    	var y = obj.offsetTop;

    	var tmpObj = obj.offsetParent;
    	while ((tmpObj!=_offObj) && tmpObj)
    	{
    		x += tmpObj.offsetLeft + tmpObj.clientLeft - tmpObj.scrollLeft;
    		y += tmpObj.offsetTop  + tmpObj.clientTop - tmpObj.scrollTop;
    		tmpObj = tmpObj.offsetParent;
    	}
    	
    	return ([x, y,obj.offsetWidth,obj.offsetHeight]);
    },  
    getNumberOfDays :function (year,month)
    {
    	var numDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
    	var n= numDays[month];
    	if (month==1 && (year%4==0 && year%100!=0 || year%400==0))
    	{
    	   n++;
    	}
    	return n;
    },
    formatDateTime:function(date,mode,separator)
    {
      	if(!this.isDate(date))
      		date = new Date();
      	
      	if (!mode) mode="datetime";    		
		switch (mode)
		{
			case "date":{
				return getDateString(date);
				break;
			}
			case "time":{
				return getTimeString(date);
				break;
			}
			case "datetime":{
				return getDateString(date)+" "+getTimeString(date);
				break;
			}
			default:{
				return getDateString(date)+" "+getTimeString(date);
				break;
			}
		}
    	   	
    	function getDateString(date)
    	{
    		var years  = date.getFullYear();
    		var months = date.getMonth()+1;
    		var days   = date.getDate();    		
    		if (months<10) months = "0" + months;
    		if (days<10)   days = "0" + days;
    		if (separator == null)
    			return years+ "-" + months + "-" + days;
    		else 
    			return years + separator + months + separator + days;
    	}
    	function getTimeString(date)
    	{
    		var hours = date.getHours();
    		var minutes = date.getMinutes();
    		var seconds = "00";    		
    		if (hours<10) hours="0"+hours;
    		if (minutes<10) minutes="0"+minutes;    		
    		return hours+":"+minutes+":"+seconds;
    	}    	
    },   
	addEvents:function(element,eventName,eventHander)
	{
		/* 火狐、IE事件兼容处理 */
	   	if(window.attachEvent)
	 		element.attachEvent("on" + eventName, eventHander );
	 	else
	 		element.addEventListener(eventName, eventHander, false);
	},
	
    fireUserEvent :function (function_name,param)
    {
    	var result;
        var paramstr="";
        
        if (arguments.length == 2)
    	{
    		for(var i=0; i<param.length; i++)
    		{
    			if (i==0)
    			{	
    				paramstr="param["+i+"]";
                }else
    			{
    				paramstr=paramstr+",param["+i+"]";
    			}
            }
       }
        if (this.isfireuserEvent(function_name)){
         	eval("result="+function_name+"("+paramstr+");");
         }
      
         return result;
    },
   
    isfireuserEvent :function (function_name)
    {	
    	var result = false;
    	
    	if (this.isEmpty(function_name))
    		return result;
    	
    	eval("result=(typeof("+function_name+")!=\"undefined\");");
    
        return result;
    },
    
    
    getID:function ()
    {
    	 this.IDseq = this.IDseq + 1;
    	 var date = new Date();
    	 return date.getHours() + date.getMinutes() + date.getSeconds()+ this.IDseq ;
    	
    },  
    
    /* 截取字符串px */
    getPx:function(value){
    	if(this.isDefined(value)){
    		return -1;
    	}
    	return this.getInt(value.substring(0,value.length-2));
    },
    
    getInt:function (value)
    {
    	if (this.isDefined(value))
			return -1;
    	
    	var result = parseInt(value);
    	if (isNaN(result)){ result = -1;}
    	return result;
    },
    
    getFloat:function(value)
    {
    	if (this.isDefined(value))
			return -1;
    	
    	var result = parseFloat(value);
		if (isNaN(result)){ result = -1;}
		return result;
	},
	
	isTrue:function (value)
	{
		if (this.isEmpty(value))
			return false;
		if(this.isBoolean(value))
			return value;
		if (this.isString(value))
		{
			return (value.isEqual("1") ||
				value.toLowerCase().isEqual("true") || value.isEqual("T") ||
				value.toLowerCase().isEqual("yes") || value.toLowerCase().isEqual("on"));
		}
	},
	
    isEmpty : function(obj){
        return obj === null || obj === undefined|| ((Yacon.isString(obj) && !obj.length)) || ((Yacon.isArray(obj) && !obj.length));
    },

    isArray : function(obj){
        return Object.prototype.toString.apply(obj) === '[object Array]';
    },

    isDate : function(obj){
        return Object.prototype.toString.apply(obj) === '[object Date]';
    },

    isObject : function(obj){
    	if (!this.isDefined(obj))
    		return Object.prototype.toString.call(obj) === '[object Object]' ||typeof (obj) == "object";
    	else
    		return false;
    },

    isFunction : function(obj){
        return Object.prototype.toString.apply(obj) === '[object Function]';
    },

    isNumber : function(obj){
        return typeof obj === 'number';
    },    
    isString : function(obj){
        return typeof obj === 'string';
    },

    isBoolean : function(obj){
        return typeof obj === 'boolean';
    },

    isElement : function(obj) {
        return obj ? !!obj.tagName : false;
    },

    isDefined : function(obj){    	
        return typeof obj == 'undefined';
    },
    
    isNull:function(obj){
    	return !obj && typeof obj != "undefined" && obj != 0;
    },
    
    getTD :function (element)
    {
    	while (element.tagName.toUpperCase() != "TD" && element.tagName.toUpperCase() != "TH")
    	{
    		element = element.parentNode;
    		if (element == null)
    			break;
    	}

    	return(element);
    },

    getTR: function (element)
    {
    	
    	while (element.tagName.toUpperCase() != "TR")
    	{
    		element = element.parentNode;

    		if (element == null)
    				break;
    	}
    	return(element);    
    	
    },
    
    getBody :function(element)
    {
    	var tag = element.tagName.toUpperCase();

    	while (tag != "TABLE" && tag != "TBODY" && tag != "TH" && tag != "THEAD" && tag != "TFOOT")
    	{
    		element = element.parentNode;

    		if (element == null)
    			break;

    		tag = element.tagName.toUpperCase();
    	}

    	return(element);
    },
    getTable :function (element)
    {
    	while (element.tagName.toUpperCase() != "TABLE")
    	{
    		element = element.parentNode;

    		if (element == null)
    			break;
    	}

    	return(element);
    },
    getSelection:function(oInput)
	{
       	if(oInput.createTextRange)
    	{
       		if(document.selection){
       			var s = document.selection.createRange().duplicate();
        		s.moveStart("character",-oInput.value.length);
        		var p1 = s.text.length;
                    
        		var s = document.selection.createRange().duplicate();
        			s.moveEnd("character",oInput.value.length);
        		
        		var p2 = oInput.value.lastIndexOf(s.text);
        		if(s.text == "")
        			p2 = oInput.value.length;
                
        		return {start:p2,end:p1};
       		}
       		else{
       			return {start:oInput.selectionStart,end:oInput.selectionEnd};
       		}
    		    
    	}else 
    	{
    		return {start:oInput.selectionStart,end:oInput.selectionEnd};
        }
	},
    processException :function(e)
    {
    	switch (typeof(e))
    	{
    		case "string":
    		{
    			if (e!="abort")
    			{
    				if (e)
    					alert(e);
    				else
    					alert(constErrUnknown);
    			}
    			break;
    		}
    		case "object":
    		{
    			alert(e.description+"\n"+":"+(e.number & 0xFFFF));
    			break;
    		}
    	}
    },
    showModal :function(context)
    {
    	
    	//遮罩层部分
    	if(window.windowType == "1"){
    		window.pageLayer.showStyle({
        		backgroundColor:"black",
        	    filter:"alpha(opacity=30)",
        	    opacity:".70"
        	});
    	}
   		
		var arg = new Object();	

		var url    = "about:blank";
		var width  = "500px";
		var height = "250px";
		var isExitSupport = true;
		
		for(var unit in context)
		{
            if (unit.isEqual("width"))
            	width = context[unit];
            else  if (unit.isEqual("height"))
            	height = context[unit];
            else  if (unit.isEqual("url"))
            	url = context[unit];
            else if (unit.isEqual("isExitSupport"))
            	isExitSupport = context[unit];
            else 
            	arg[unit] = context[unit];
        }
    	
		if(window.locationType == "1"){
			var phasicHeight = document.body.scrollHeight;
	    	var phasicWidth = document.body.scrollWidth;
	    	
	    	var imgWidth = this.getPx(width);
	    	var imgHeight = this.getPx(height);
	    	
	    	var styleLeft = 100;
	    	var styleTop = 10;
	    	
	    	if(imgWidth <= phasicWidth){
	    		styleLeft = (phasicWidth - imgWidth) / 2;
	    	}
	    	
	    	if(imgHeight <= phasicHeight){
	    		styleTop = (phasicHeight - imgHeight) / 2;
	    	}
		}
    		
		var dialogArg = "dialogwidth:" + width + "; dialogheight:"+height+";center:yes;help:no;resizable:yes;scroll:no;status:no";
		
		if(window.windowType == "0"){
			
			//ShowModalDialog方式
			return window.showModalDialog(url,arg, dialogArg);
			
		}else{
			
			//首层居中
			if(window.locationType == "1"){
				var param = {width:width,height:height,url:url,styleLeft:styleLeft,styleTop:styleTop,isExitSupport:isExitSupport};
			}else{
				var param = {width:width,height:height,url:url,styleLeft:100,styleTop:10,isExitSupport:isExitSupport};
			}
				
			//Div方式
			if(!Yacon.isObject(window.winModel)){
				window.winModel = new Yacon.widget.DetailModel(param);
			}else{
				window.winModel = null;
				delete window.winModel;
				window.winModel = new Yacon.widget.DetailModel(param);
			}
			
	    	window.winModel.setArg(arg);
	    	
	    	window.winModel.show();
		}			
	  
    },
    
    /**
     * 单独使用 DIV 方式
     * @param context
     */
    showModalView :function(context)
    {
    	
    	//遮罩层部分
    	window.pageLayer.showStyle({
    		backgroundColor:"black",
    	    filter:"alpha(opacity=30)",
    	    opacity:".70"
    	});
    	
		var arg = new Object();	

		var url    = "about:blank";
		var width  = "500px";
		var height = "250px";
		var isExitSupport = true;
		
		for(var unit in context)
		{
            if (unit.isEqual("width"))
            	width = context[unit];
            else  if (unit.isEqual("height"))
            	height = context[unit];
            else  if (unit.isEqual("url"))
            	url = context[unit];
            else if (unit.isEqual("isExitSupport"))
            	isExitSupport = context[unit];
            else 
            	arg[unit] = context[unit];
        }
		
		if(window.locationType == "1"){
			var phasicHeight = document.body.scrollHeight;
	    	var phasicWidth = document.body.scrollWidth;
	    	
	    	var imgWidth = this.getPx(width);
	    	var imgHeight = this.getPx(height);
	    	
	    	var styleLeft = 100;
	    	var styleTop = 10;
	    	
	    	if(imgWidth <= phasicWidth){
	    		styleLeft = (phasicWidth - imgWidth) / 2;
	    	}
	    	
	    	if(imgHeight <= phasicHeight){
	    		styleTop = (phasicHeight - imgHeight) / 2;
	    	}
		}
		
		//首层居中
		if(window.locationType == "1"){
			var param = {width:width,height:height,url:url,styleLeft:styleLeft,styleTop:styleTop,isExitSupport:isExitSupport};
		}else{
			var param = {width:width,height:height,url:url,styleLeft:100,styleTop:10,isExitSupport:isExitSupport};
		}
		
		//Div方式
		if(!Yacon.isObject(window.winModel)){
			window.winModel = new Yacon.widget.DetailModel(param);
		}else{
			window.winModel = null;
			delete window.winModel;
			window.winModel = new Yacon.widget.DetailModel(param);
		}
		
    	window.winModel.setArg(arg);
   	
    	window.winModel.show();
  
    },
    
    /* 
    * 用来遍历指定对象所有的属性名称和值 
    * obj 需要遍历的对象 
    */ 
    allProperty: function(obj) { 

		// 用来保存所有的属性名称和值
		var props = "";
		// 开始遍历
		for ( var p in obj) {
			// 方法
			if (typeof (obj[p]) == " function ") {
				obj[p]();
			} else {
				// p 为属性名称，obj[p]为对应属性的值
				props += p + " = " + obj[p] + " \t ";
			}
		}
		// 最后显示所有的属性
		alert(props); 
    },
    
    /* 获取页面地址路径 */
    getRootPath:function(){
        //获取当前网址，如： http://localhost:8083/uimcardprj/share/meun.jsp
        var curWwwPath=window.document.location.href;
        //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
        var pathName=window.document.location.pathname;
        var pos=curWwwPath.indexOf(pathName);
        //获取主机地址，如： http://localhost:8083
        var localhostPaht=curWwwPath.substring(0,pos);
        //获取带"/"的项目名，如：/uimcardprj
        var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
        return(localhostPaht+projectName);
    },
    
    /* 获取页面相对地址 */
    getRelaPath:function(){
    	var pathName=window.document.location.pathname;
    	return pathName.substr(pathName.substr(1).indexOf('/')+1);
    },

    /* HTTP/HTTPS校验 */
    verifySSL : function(){
    	var rootPath = window.document.location.href;
    	var path = rootPath.indexOf("https://");
    	if(path<0){
    		return false;
    	}else{
    		return true;
    	}
    },
    
    /* 防止普通注入 */   
    stripDefend:function(s){
    	var pattern = new RegExp("[%`~!@#$^&*()=|{}';',\\[\\]<>?~！@#￥……&*（）――|{}【】‘；：”“'。，、？]") ;//格式 RegExp("[在中间定义特殊过滤字符]")
		var rs = "";
		if(s.length > 0){
			for (var i = 0; i < s.length; i++) {
				rs = rs + s.substr(i, 1).replace(pattern, '');
			}
		}
		return rs;
    },
    
    /* 防止SQL注入 */
    stripSQL:function(oField){
    	 var re= /select|update|having|delete|exec|count|’|"|=|;|>|<|%/i;
         if ( re.test(oField) )
         {
           alert("请您不要在参数中输入特殊字符和SQL关键字！");
       	  location.href="";
    		 } 
         return oField;
    },
    
    /* 获取全路径 */
    getFullPath:function(relaPath,sysCode){
    	
    	if(window.parameter.sessionID){
    		if(relaPath.indexOf("?")>0){
    			relaPath += "&sessionID="+window.parameter.sessionID;
    		}else{
    			relaPath += "?sessionID="+window.parameter.sessionID;
    		}    		
    	}else if(window.parent.parameter.sessionID){
    		if(relaPath.indexOf("?")>0){
    			relaPath += "&sessionID="+window.parameter.sessionID;
    		}else{
    			relaPath += "?sessionID="+window.parameter.sessionID;
    		} 
    	}
    	
    	var sendSet=new Yacon.data.DataSet();  	
    	if(sysCode){
    		sendSet.setWhereField("sys_code_bak",sysCode);       	
    	}   	
    	sendSet.setWhereField("rela_path_bak",relaPath.encode());
    	sendSet.switchMessage("getFullPath");
    	
    	var fullPath = "";
    	if(sendSet.next()){
			fullPath= sendSet.getFieldValue("fullPath").decode();		
		}else{
			fullPath = relaPath;			
		}
    	
    	return fullPath;
    },
    
    /* 获取树实际路径 */
    getTreeIncPath:function(){
    	 var url = window.parameter.url;
	   	 var sysCode = window.parameter.sysCode;
	   	 
	   	 var path = "";
	   	 if(sysCode){
	   		 path = Yacon.getFullPath(url,sysCode);
	   	 }else{
	   		 path = Yacon.getFullPath(url);
	   	 }
	   	 
	     //传入场景信息
	   	 path += "&sceId="+window.parameter.sceId;
	   	 
	   	 //添加后续参数
	   	 if(window.parameter.param){
	   		 var params = window.parameter.param.split(",");
	   		 for(var i=0;i<params.length;i++){
	   			 path += "&"+params[i]+"="+Yacon.getUrlParam(params[i], window.location.href);
	   		 }
	   	 }
	   	 
	   	 return path;
    },
    
    /* 获取跳转页面 */
    getSkipPath:function(relaPath,sysCode){
    	var fullPath = Yacon.getFullPath(relaPath, sysCode);
    	var exitPath = Yacon.getFullPath("/frames/common/skip/skipClose.jsp",window.parameter.appid);
    	var retPath = "/"+window.parameter.appid+"/frames/common/skip/skipOpen.jsp?skipUrl="+fullPath.encode()+"&exitUrl="+exitPath.encode();
    	return retPath;
    },
    
    /* 获取通用参数 */
    getCommonParam:function(url){
    	
    	if(url){
    		if(window.parameter.appid){
    			if(!Yacon.isUrlParam("appid",url)){   				   			
    				url += "&appid="+window.parameter.appid;
    			}
        	}
        	
        	if(window.parameter.sceId){
        		if(!Yacon.isUrlParam("sceId",url)){
        			url += "&sceId="+window.parameter.sceId;
        		}       		
        	}
        	
        	if(window.parameter.sessionID){
        		if(!Yacon.isUrlParam("sessionID",url)){
        			url += "&sessionID="+window.parameter.sessionId;
        		}      		
        	}
        	
        	if(window.parameter.pwAppId){
        		if(!Yacon.isUrlParam("pwAppId",url)){
        			url += "&pwAppId="+window.parameter.pwAppId;
        		}
        	}
        	
        	return url;
    	}else{
    		var path = "";
        	
        	if(window.parameter.appid){
        		path += "&appid="+window.parameter.appid;
        	}
        	
        	if(window.parameter.sceId){
        		path += "&sceId="+window.parameter.sceId;
        	}
        	
        	if(window.parameter.sessionID){
        		path += "&sessionID="+window.parameter.sessionID;
        	}
        	
        	if(window.parameter.pwAppId){
        		path += "&pwAppId="+window.parameter.pwAppId;
        	}
        	
        	return path;
    	}
    	
    },
    
    /* 获取URL参数 */
    getUrlParam: function(name,url) {
       
       var actUrl = "";
       if(url){
    	   actUrl = url;
       }
       else{
    	   actUrl = location.search;
       }
       
	   var theRequest = new Object();
	   if (actUrl.indexOf("?") != -1) {
	      var str = actUrl.substr(1);
	      strs = str.split("&");
	      for(var i = 0; i < strs.length; i ++) {
	         theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
	      }
	   }
	   return theRequest[name];
    },
    
    isUrlParam:function(name,url){
    	var actUrl = "";
        if(url){
     	   actUrl = url;
        }
        else{
     	   actUrl = location.search;
        }
        
 	   var theRequest = new Object();
 	   if (actUrl.indexOf("?") != -1) {
 	      var str = actUrl.substr(1);
 	      strs = str.split("&");
 	      for(var i = 0; i < strs.length; i ++) {
 	         theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
 	      }
 	   }
 	   return Yacon.isNull(theRequest[name])
    },
    
    isBootstrap:function(){
    	return window.log.isNewTheme;
    }
    
};


Yacon.path={
		getCssPath:function(cssfile)
		{
			var css="";
			if (!Yacon.isEmpty(contextPath))
				css = css.concat(contextPath);
			
			if (!Yacon.isEmpty(stylePath))
				css = css.concat(stylePath);
		
			css = css.concat("/"+cssfile)
			
			return css;
			
		},
		getImgPath:function(imgfile)
		{
			var img ="";
			if (!Yacon.isEmpty(contextPath))
				img = img.concat(contextPath);
			
			return img.concat("/public/images/skin_blue/"+imgfile);;
		}
};

/**
 * 平台基本类空间定义
 **/
Yacon.core={};
Yacon.widget={
		/**
		 * 文本类型
		 */
		FIELD_TEXT :"TEXT",
		/**
		 * 整数类型
		 */
		FIELD_INT: "INT",
		/**
		 * 数字类型
		 */
		FIELD_NUMBER:"NUMBER",
		/**
		 * 金钱类型
		 */
		FIELD_MONEY :"MONEY",
		/**
		 * 身份证类型
		 */
		FIELD_CARD:"CARD",
		/**
		 * 邮件类型
		 */
		FIELD_EMAIL:"EMAIL",
		/**
		 * URL类型
		 */
		FIELD_URL:"URL",
		/**
		 * 日期类型
		 */
		FIELD_DATE:"DATE",
		/**
		 * 密码输入
		 */
		FIELD_PASSWORD:"PASSWORD",
		/**
		 * 对选框输入
		 */
		FIELD_CHECKBOX:"CHECKBOX",
		/**
		 * 单选框输入
		 */
		FIELD_RADIO:"RADIO",
		/**
		 * 文件提交
		 */
		FIELD_FILE:"FILE",

		/**
		 * IP地址输入
		 */
		FIELD_IP:"IP",		
		
		/**
		 * 下拉普通选择类型
		 */
		FIELD_DROP_SELECT:"DROP_SELECT",	
		
		/**
		 * 下拉普通LIST
		 */
		FIELD_DROP_LIST :"DROP_LIST",
		
		/**
		 * 下拉普通TREE
		 */
		FIELD_DROP_TREE : "DROP_TREE",
		
		/**
		 * 下拉普通Window
		 */
		FIELD_DROP_WIN : "DROP_WIN",
		
		/**
		 * 下拉过滤
		 */
		FIELD_DROP_FILTER : "DROP_FILTER",
		
		/**
		 * 下拉普通DATE
		 */
		FIELD_DROP_DATE : "DROP_DATE",
		
		/**
		 * 下拉普通MONTH
		 */
		FIELD_DROP_MONTH :"DROP_MONTH",
		
		/**
		 * 下拉普通TIME
		 */
		FIELD_DROP_TIME : "DROP_TIME",
		
		/**
		 * 下拉普通DATETIME
		 */
		FIELD_DROP_DATETIME:"DROP_DATETIME",	
		
		/**
		 * TEXTAREA输入
		 */
		FIELD_TEXTAREA:"TEXTAREA",
		/**
		 * left 菜单隐藏通过外部控制
		 */
		HIDE_TYPE_WORK:"work",
		/**
		 * left 菜单隐藏通过内部控制
		 */
		HIDE_TYPE_CHECK:"check"	
};

Yacon.util={};
Yacon.widget.grid ={};
Yacon.widget.grid.list={};
Yacon.canvas={};
Yacon.data={};
Yacon.widget.grid.multiple={};
/**
 * 初始构造函数
 */
(function(){  
	      
	window.uag = navigator.userAgent.toLowerCase();
    window.docMode = document.documentMode;
    window.isStrict = document.compatMode == "CSS1Compat";
    window.isfirefox = Yacon.regCheck(/firefox/);
    window.isOpera = Yacon.regCheck(/opera/);
    window.isChrome = Yacon.regCheck(/\bchrome\b/);
    window.isWebKit = Yacon.regCheck(/webkit/);
    window.isSafari = !isChrome && Yacon.regCheck(/safari/);
    window.isSafari2 = isSafari && Yacon.regCheck(/applewebkit\/4/);
    window.isSafari3 = isSafari && Yacon.regCheck(/version\/3/);
    window.isSafari4 = isSafari && Yacon.regCheck(/version\/4/);
    window.isIE11 = uag.indexOf("trident") > -1 && uag.indexOf("rv") > -1;
    window.isIE = Yacon.regCheck(/msie/);    
    window.isIE10 = isIE && (Yacon.regCheck(/msie 10/));
    window.isIE9 = isIE && (Yacon.regCheck(/msie 9/));
    window.isIE7 = isIE && (Yacon.regCheck(/msie 7/) || docMode == 7);
    window.isIE8 = isIE && (Yacon.regCheck(/msie 8/) && docMode != 7);
    window.isIE6 = isIE && (Yacon.regCheck(/msie 6/) && docMode != 7);
//    window.isIE6 = isIE && !isIE7 && !isIE8 && !isIE9 && !isIE10;
    window.isGecko = !isWebKit && Yacon.regCheck(/gecko/);
    window.isGecko2 = isGecko && Yacon.regCheck(/rv:1\.8/);
    window.isGecko3 = isGecko && Yacon.regCheck(/rv:1\.9/);
    window.isBorderBox = isIE && !isStrict;
    window.isWindows = Yacon.regCheck(/windows|win32/);
    window.isMac = Yacon.regCheck(/macintosh|mac os x/);
    window.isAir = Yacon.regCheck(/adobeair/);
    window.isLinux = Yacon.regCheck(/linux/);
    window.isSecure = /^https/i.test(window.location.protocol);
  
    if(window.isIE6){
        try{
        	document.execCommand("BackgroundImageCache", false, true);
        }catch(e){}
    }
    window.constErrUnknown = "程序引起未知错误！";
    
    /* 弹窗方式 0:showModelDialog; 1:Div */
    window.windowType = "0";
    
    /* 窗口定位方式 0:无限居中;1:首层居中;2:绝对定位 */
    window.locationType = "0";
        
})();

(function (bool) {
    function setInnerText(o, s) {
        while (o.childNodes.length != 0) {
            o.removeChild(o.childNodes[0]);
        }

        o.appendChild(document.createTextNode(s));
    }

    function getInnerText(o) {
        var sRet = "";

        for (var i = 0; i < o.childNodes.length; i ++) {
            if (o.childNodes[i].childNodes.length != 0) {
                sRet += getInnerText(o.childNodes[i]);
            }

            if (o.childNodes[i].nodeValue) {
                if (o.currentStyle.display == "block") {
                    sRet += o.childNodes[i].nodeValue + "\n";
                } else {
                    sRet += o.childNodes[i].nodeValue;
                }
            }
        }

        return sRet;
    }

    if (bool) {
        HTMLElement.prototype.__defineGetter__("currentStyle", function () {
            return this.ownerDocument.defaultView.getComputedStyle(this, null);
        });

        HTMLElement.prototype.__defineGetter__("innerText", function () {
            return getInnerText(this);
        })

        HTMLElement.prototype.__defineSetter__("innerText", function(s) {
            setInnerText(this, s);
        })
    }
})(window.isfirefox);



var _array_dataset 				= new Array();
var _array_element 				= new Array();
var _array_nullElement 			= new Array();
var _array_resizeElement 		= new Array();
var _array_minLengthElement 	= new Array();


window.log=
{
		/**
		 * 总调试开关
		 */
		allControl:false,
		/**
		 * HttpSwitch.js:
		 * HttpSwitch_sendAsynchronism
		 */
		excuteSend :true,
		/**
		 * HttpSwitch.js:
		 * HttpSwitch_sendSynchronization
		 */
		refreshSend:true,
		/**
		 * XmlCompact.js:
		 * analyzeData
		 */
		xmlRecv :true,
		/**
		 * XmlCompact.js:
		 * analyzeData
		 */
		xmlLoadData:false,
		/**
		 * 是否新主题
		 */
		isNewTheme:false

};

window.skip = {
	/* 关闭 */	
	close:function(){
		var exitPath = Yacon.getUrlParam("exitUrl").decode();
		exitPath += "&retVal="+window.returnValue;
		window.location.href = exitPath;
	}	
};
